
global data "C:\Users\ASUS\Documents\Projek\83.Tranformasi dan Halal\3. Data"
import excel "$data\Halal Country (1).xlsx", sheet("data") firstrow clear
duplicates drop countrycode, force

merge 1:m countrycode  using "$data\Data Penelitian Halal and Transformation.dta"
recode _merge(3=1) (min/max=0), gen(halalauthority)



egen id=group( countrycode)
xtset id year

encode  incomelevelname, gen(income)


encode regionname, gen(regional_cate)

xtreg nv_agr_totl_zs halalauthority eg_elc_accs_zs it_net_user_zs fs_ast_prvt_gd_zs ne_con_prvt_zs i.income, fe i(regional_cate)


gen sample_FIX=e(sample)


outreg2 using "$data\Hasil Pleminary Result 2.doc", replace  ctitle(Hasil nv_agr_totl_zs) 
gen sample=e(sample)
ta sample



asdoc sum nv_srv_totl_zs nv_agr_totl_zs nv_ind_manf_zs halalauthority eg_elc_accs_zs it_net_user_zs fs_ast_prvt_gd_zs ne_con_prvt_zs i.income if sample_FIX==1


xtreg nv_ind_manf_zs halalauthority eg_elc_accs_zs it_net_user_zs fs_ast_prvt_gd_zs ne_con_prvt_zs i.income, fe i(regional_cate)

gen sample_re=e(sample)
foreach i in nv_srv_totl_zs nv_agr_totl_zs nv_ind_manf_zs{
xtreg `i' halalauthority eg_elc_accs_zs it_net_user_zs fs_ast_prvt_gd_zs ne_con_prvt_zs i.income

outreg2 using  "$data\Hasil Pleminary Result 2.doc", append ctitle(Hasil `i') label 


}

